import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '日期',
    align:"center",
    dataIndex: 'reportTime',
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text)
    },
   },
   {
    title: '访客数',
    align:"center",
    dataIndex: 'visitorCount'
   },
   {
    title: '加购人数',
    align:"center",
    dataIndex: 'jiaGouCount'
   },
   {
    title: '支付金额',
    align:"center",
    dataIndex: 'payedMoney'
   },
   {
    title: '支付商品数',
    align:"center",
    dataIndex: 'payedGoodCount'
   },
   {
    title: '支付用户数',
    align:"center",
    dataIndex: 'payedClientCount'
   },
   {
    title: '支付子订单数',
    align:"center",
    dataIndex: 'payedOrderCount'
   },
   {
    title: '支付转化率',
    align:"center",
    dataIndex: 'payedConversionRate'
   },
   {
    title: '客单价',
    align:"center",
    dataIndex: 'perCustomerPrice'
   },
   {
    title: '页面价',
    align:"center",
    dataIndex: 'priceOnPage'
   },
   {
    title: '活动价',
    align:"center",
    dataIndex: 'priceOnActivity'
   },
   {
    title: '到手价',
    align:"center",
    dataIndex: 'priceOnPay'
   },
   {
    title: '销售链接',
    align:"center",
    dataIndex: 'saleLinkId'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '日期',
    field: 'reportTime',
    component: 'DatePicker',
  },
  {
    label: '访客数',
    field: 'visitorCount',
    component: 'InputNumber',
  },
  {
    label: '加购人数',
    field: 'jiaGouCount',
    component: 'InputNumber',
  },
  {
    label: '支付金额',
    field: 'payedMoney',
    component: 'InputNumber',
  },
  {
    label: '支付商品数',
    field: 'payedGoodCount',
    component: 'InputNumber',
  },
  {
    label: '支付用户数',
    field: 'payedClientCount',
    component: 'InputNumber',
  },
  {
    label: '支付子订单数',
    field: 'payedOrderCount',
    component: 'InputNumber',
  },
  {
    label: '支付转化率',
    field: 'payedConversionRate',
    component: 'InputNumber',
  },
  {
    label: '客单价',
    field: 'perCustomerPrice',
    component: 'InputNumber',
  },
  {
    label: '页面价',
    field: 'priceOnPage',
    component: 'InputNumber',
  },
  {
    label: '活动价',
    field: 'priceOnActivity',
    component: 'InputNumber',
  },
  {
    label: '到手价',
    field: 'priceOnPay',
    component: 'InputNumber',
  },
  {
    label: '销售链接',
    field: 'saleLinkId',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}